/**
 * 
 */
package com.edocbase.desktop.plugins.mdiary;

import org.eclipse.jface.viewers.TreeNode;

import com.edocbase.desktop.lightweight.nodes.URLTreeNode;
import com.edocbase.desktop.lightweight.widgets.BreadcrumbBar;
import com.edocbase.desktop.lightweight.widgets.BreadcrumbItem;
import com.edocbase.desktop.lightweight.widgets.BreadcruumbItemCreateDelegate;


/**
 * @author lifei114@gmail.com
 *
 */
public class MDiaryItemCreateDelegate implements BreadcruumbItemCreateDelegate {
	private MDiaryUI diaryUI = null;
	/**
	 * @param mDiaryUI 
	 * 
	 */
	public MDiaryItemCreateDelegate(MDiaryUI mDiaryUI) {
		this.diaryUI = mDiaryUI;
	}

	/* (non-Javadoc)
	 * @see com.edocbase.desktop.lightweight.widgets.BreadcruumbItemCreateDelegate#createItem(com.edocbase.desktop.lightweight.widgets.BreadcrumbBar, org.eclipse.jface.viewers.TreeNode)
	 */
	@Override
	public BreadcrumbItem createItem(BreadcrumbBar bar, TreeNode node) {
		if (node instanceof URLTreeNode){
			URLBreadcrumbItem item = new URLBreadcrumbItem(bar,this);
			return item;
		}else{
			BreadcrumbItem item = new BreadcrumbItem(bar);
			return item;
		}
	}

	public void gotoURL(String text) {
		//diaryUI.openURL(text, false);
	}

}
